From: kfraser@localhost.localdomain Date: Mon, 31 Jul 2006 09:40:21 +0000 (+0100) Subject: [XEN] Some suspicion that we may enter an infinite X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15754^2~39 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=b4b462732b89593c721f7852a5323ee18fd367ea;p=xen.git [XEN] Some suspicion that we may enter an infinite #PF loop due to broken spurious pagefault detection. Beef up the tracing on that code path so we can catch some useful info if it happens. Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index aac1d70e76..44913b2f42 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -733,7 +733,10 @@ static int __spurious_page_fault( (l2e_get_flags(l2e) & disallowed_flags) ) return 0; if ( l2e_get_flags(l2e) & _PAGE_PSE ) - return 1; + { + l1e = l1e_empty(); /* define before use in debug tracing */ + goto spurious; + } l1t = map_domain_page(mfn); l1e = l1t[l1_table_offset(addr)]; @@ -742,6 +745,22 @@ static int __spurious_page_fault( if ( !(l1e_get_flags(l1e) & required_flags) || (l1e_get_flags(l1e) & disallowed_flags) ) return 0; + + spurious: + DPRINTK("Spurious fault in domain %u:%u at addr %lx, e/c %04x\n", + current->domain->domain_id, current->vcpu_id, + addr, regs->error_code); +#if CONFIG_PAGING_LEVELS >= 4 + DPRINTK(" l4e = %"PRIpte"\n", l4e_get_intpte(l4e)); +#endif +#if CONFIG_PAGING_LEVELS >= 3 + DPRINTK(" l3e = %"PRIpte"\n", l3e_get_intpte(l3e)); +#endif + DPRINTK(" l2e = %"PRIpte"\n", l2e_get_intpte(l2e)); + DPRINTK(" l1e = %"PRIpte"\n", l1e_get_intpte(l1e)); +#ifndef NDEBUG + show_registers(regs); +#endif return 1; } @@ -839,11 +858,7 @@ asmlinkage int do_page_fault(struct cpu_user_regs *regs) if ( unlikely(!guest_mode(regs)) ) { if ( spurious_page_fault(addr, regs) ) - { - DPRINTK("Spurious fault in domain %u:%u at addr %lx\n", - current->domain->domain_id, current->vcpu_id, addr); return EXCRET_not_a_fault; - } if ( likely((fixup = search_exception_table(regs->eip)) != 0) ) {